package com.koo.modules.cx.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.koo.common.utils.PageUtils;
import com.koo.common.utils.Query;
import com.koo.modules.cx.dao.CxUploadMemberDataDao;
import com.koo.modules.cx.entity.CxUploadMemberDataEntity;
import com.koo.modules.cx.service.CxUploadMemberDataService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.Map;

@Slf4j
@Service
public class CxUploadMemberDataServiceImpl extends ServiceImpl<CxUploadMemberDataDao, CxUploadMemberDataEntity> implements CxUploadMemberDataService {


    @Override
    public PageUtils queryPage(Map<String, Object> params) {

        Object key = params.get("key");
        LambdaQueryWrapper<CxUploadMemberDataEntity> queryWrapper = new LambdaQueryWrapper<>();
//        queryWrapper.like(MyStrUtil.isNotEmpty(key), CxUploadMemberDataEntity::getName, key)
//                .or().eq(MyStrUtil.isNotEmpty(key), CxUploadMemberDataEntity::getCode, key);

        IPage<CxUploadMemberDataEntity> page = this.page(
                new Query<CxUploadMemberDataEntity>().getPage(params),
                queryWrapper
        );

        return new PageUtils(page);
    }

}